/****** Object:  Stored Procedure dbo.spr_UpdateExDBClientVisaByPK  ******/

 use [TourIS]
 GO

 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spr_UpdateExDBClientVisaByPK]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
 drop procedure [dbo].[spr_UpdateExDBClientVisaByPK]
 GO

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS OFF
 GO

 CREATE  PROCEDURE [dbo].[spr_UpdateExDBClientVisaByPK]
 (
	@appdate smalldatetime,
	@appresdate smalldatetime,
	@clientid int,
	@orig_compid int,
	@compid int,
	@empextprocessedby smallint,
	@empprocessedby smallint,
	@enteredby smallint,
	@entrydate smalldatetime,
	@extappdate smalldatetime,
	@extendeddays int,
	@extprice decimal(10,
 2),
	@extresdate smalldatetime,
	@fromdate smalldatetime,
	@isapproved bit,
	@isextapproved bit,
	@price decimal(10,
 2),
	@tilldate smalldatetime,
	@orig_visaid int,
	@visaid int,
	@visaserial varchar(50),
	@visatypeid int
 )

 AS

 BEGIN
	SET NOCOUNT ON
	DECLARE @Err int

	UPDATE [ClientVisa]
	SET
		[AppDate] = @appdate,
		[AppResDate] = @appresdate,
		[ClientId] = @clientid,
		[CompId] = @compid,
		[EmpExtProcessedBy] = @empextprocessedby,
		[EmpProcessedBy] = @empprocessedby,
		[EnteredBy] = @enteredby,
		[EntryDate] = @entrydate,
		[ExtAppDate] = @extappdate,
		[ExtendedDays] = @extendeddays,
		[ExtPrice] = @extprice,
		[ExtResDate] = @extresdate,
		[FromDate] = @fromdate,
		[IsApproved] = @isapproved,
		[IsExtApproved] = @isextapproved,
		[Price] = @price,
		[TillDate] = @tilldate,
		[VisaID] = @visaid,
		[VisaSerial] = @visaserial,
		[VisaTypeId] = @visatypeid

	WHERE
	[CompId] = @orig_compid
	AND [VisaID] = @orig_visaid


	SET @Err = @@Error
	RETURN @Err
 END

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS ON
 GO

